package com.multicampus.minishop.view.user;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.multicampus.minishop.framework.Action;
import com.multicampus.minishop.services.user.UserService;
import com.multicampus.minishop.services.user.impl.UserServiceImpl;
import com.multicampus.minishop.user.vo.UserVO;


public class AddUserAction extends Action {

	@Override
	public String execute(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		UserVO vo=new UserVO();
		vo.setUserId(request.getParameter("userId"));
		vo.setPassword(request.getParameter("password"));
		vo.setUserName(request.getParameter("userName"));
		vo.setSsn(request.getParameter("ssn"));
		
		vo.setAddr(request.getParameter("addr"));
		vo.setPhone(request.getParameter("cellPhone"));
		vo.setEmail(request.getParameter("email"));
		
		System.out.println(vo);
		
		UserService service=new UserServiceImpl();
		service.addUser(vo);
		
		return "redirect:/user/loginView.jsp";
	}

}
